<template>
  <div id="businesslist">  
    <el-form ref="form" :model="form" label-width="80px">  
     <el-row style="margin-bottom:5px;"> 
        <el-col :span="20" style="display:flex;">
            <img class="top_img" src="@/assets/images/png1.png" style="width:40px;height:40px;margin-right:10px;"/>
            <div style="line-height: 40px;font-weight:bold:">用户档案</div>
            <el-form ref="form" label-width="80px">  
                <el-form-item label-width="0px" style="margin-left:10px;">
                    <el-input v-model="form.account" placeholder="姓名/手机号" style="width:160px;"></el-input>
                </el-form-item>
             </el-form>
            <div class="custom_button2"  style="margin-left:10px;" @click="search_but()" ></div>
        </el-col> 
        <el-col :span="4" style="text-align: center;display: flex;justify-content: flex-end;">
            <div class="custom_button_width" @click="sx_but()">刷新</div>
        </el-col> 
    </el-row> 
   
   </el-form>
   
   
   <business-list :datalist="datalist" @up_list_fun="list_fun" ></business-list>
   
     <div style="margin-top:20px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>



  </div>
</template>

<script>


import BusinessList from '@/view/Aftersale/Business/BusinessList'
export default {
  name: 'businesslist',
  data () {
    return {
      datalist:[],
      page:1,
      count:0,
      form:{
         account:''
      },
    }
  },
   components:{
      BusinessList
  },
  created(){
       this.list_fun()
  },
  mounted (){
      
  },
  methods: {
    list_fun(){
        this.post("/business_management/listOfMemberData", {
              page:this.page,
	         }).then(res => {
            this.count = res.result.count
            this.datalist = res.result.list
            console.log(res)
          })
    },
    search_but(){
        this.page = 1
        this.list_fun()
    },
    sx_but(){
        this.page = 1
        this.list_fun()
    },
    handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(val) {
        this.page = val
        this.list_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>
.see_but{
    width: 90px;
    height: 30px;
    background: #B3C0D1;
    border-radius: 18px;
    text-align: center;
    line-height: 30px;
    color:white;
    font-size: 14px;
    cursor: pointer;
}
</style>
